<!DOCTYPE html>
<html>
<head>
<%include("../../tpl/head.html"){}%>
<title>后台管理-未读消息</title>
</head>
<body class="sidebar-mini fixed skin-blue">
	<div class="wrapper">
		<!-- 头部 -->
		<%include("../../tpl/header.html"){}%>
		<!-- 网页正文 -->
		<div class="content-wrapper">
			<!-- 网页正文-面包屑 -->
			<div class="content-header">
				<h1>日志管理</h1>
				<ol class="breadcrumb">
					<li><a href="/admin/index.jspx"><i class="fa fa-dashboard"></i> 后台系统</a></li>
					<li><a href="#">系统管理</a></li>
					<li class="active">日志管理</li>
				</ol>
			</div>
			<!-- 网页正文-主体 -->
			<section class="content">
				<div class="row">
					<div class="col-xs-12">
						<div class="box">
							<div class="box-header">
								<h3 class="box-title">Hover Data Table</h3>
							</div>
							<!-- /.box-header -->
							<div class="box-body">
								<table id="jqGrid"></table>
								<div id="jqGridPager"></div>
							</div>
							<!-- /.box-body -->
						</div>
					</div>
					<!-- /.box -->
				</div>
				<!-- /.col -->
			</section>
			<!-- /.content -->
		</div>
		<!-- 网页底部 -->
		<%include("../../tpl/footer.html"){}%>
	</div>
	<%include("../../tpl/script.html"){}%>
	<script type="text/javascript">
		$(document).ready(function() {
			jqGrid.init({
				page : '${page!1}',
				colModel : [ {
					label : 'ID',
					name : 'id',
					key : true,
					width : 30,
					align : 'center',
					resizable : false
				}, {
					label : '用户',
					name : 'user',
					sortable : false
				}, {
					label : '类型',
					name : 'type',
					formatter : function(value, coulmn) {
						switch (value) {
						case 0:
							return '系统日志';
						case 1:
							return '用户登录';
						case 2:
							return '用户操作';
						default:
							return '未知';
						}
					}
				}, {
					label : '地址',
					name : 'host'
				}, {
					label : '标题',
					name : 'title'
				}, {
					label : '正文',
					name : 'content'
				}, {
					label : '创建时间',
					name : 'createTime'
				} ]
			});
			jqGrid.initNav({
				edit : false,
				add : false,
				del : false,
				view : false
			});
			jqGrid.addNavButton({
				caption : "",
				title : "清空",
				buttonicon : "glyphicon glyphicon-trash",
				onClickButton : function() {
					$.postLoading("clear.json", {}, function() {
						$('#jqGrid').clearGridData();
						layer.msg("日志已清空", {
							icon : 1,
							time : 1500
						});
					})
				}
			})
		});
	</script>
</body>
</html>
